export default class {
  //#region 社群管理
  getAsociationTypeList() {
    return this.request({
      url: "/admin/v1/community/list",
      method: "GET",
    });
  }
  addAsociationType(data) {
    return this.request({
      url: `/admin/v1/community`,
      method: "PUT",
      data,
    });
  }
  editAsociationType(id, data) {
    return this.request({
      url: `/admin/v1/community?id=${id}`,
      method: "POST",
      data,
    });
  }
  delAsociationType(id) {
    return this.request({
      url: `/admin/v1/community?id=${id}`,
      method: "DELETE",
    });
  }

  //#endregion

  // 社群帖子管理
  getAsociationPostList(data) {
    return this.request({
      url: `/admin/v1/community/news/list`,
      method: "POST",
      data,
    });
  }

  deleteAsociationPost(id) {
    return this.request({
      url: `/admin/v1/invitation?id=${id}`,
      method: "DELETE",
    });
  }

  //#region 社群活动管理
  getAsociationActList(params) {
    return this.request({
      url: "/api/admin/community_activity/",
      method: "GET",
      params,
    });
  }
  addAsociationAct(data) {
    return this.request({
      url: `/api/admin/community_activity/`,
      method: "POST",
      data,
    });
  }
  editAsociationAct(id, data) {
    return this.request({
      url: `/api/admin/community_activity/${id}/`,
      method: "PATCH",
      data,
    });
  }
  delAsociationAct(id) {
    return this.request({
      url: `/api/admin/community_activity/${id}/`,
      method: "DELETE",
    });
  }
  //#endregion

  // 评论
  asociationPostList(id) {
    return this.request({
      url: `/admin/v1/invitation/comment/list?id=${id}`,
      method: "GET",
    });
  }

  // 帖子评论删除
  asociationPostDelete(id) {
    return this.request({
      url: `/admin/v1/invitation/comment?id=${id}`,
      method: "DELETE",
    });
  }

  //#region 社群审核

  getAsociationJoinList(params) {
    return this.request({
      url: `/admin/v1/community/user_check/list`,
      method: "GET",
      params,
    });
  }
  setAsociationJoinStatus(data) {
    return this.request({
      url: `/admin/v1/community/user_check`,
      method: "POST",
      data,
    });
  }
  //#endregion

  //#region 社区活动管理

  getCommunityActType() {
    return this.request({
      url: "/admin/v1/activity/type",
      method: "GET",
    });
  }

  // 编辑社区活动分类
  editCommunityActType(id, data) {
    return this.request({
      url: `/admin/v1/activity/type?id=${id}`,
      method: "POST",
      data,
    });
  }

  // 新增社区活动分类
  addCommunityActType(data) {
    return this.request({
      url: `/admin/v1/activity/type`,
      method: "PUT",
      data,
    });
  }

  // 删除活动分类
  delCommunityActType(id) {
    return this.request({
      url: `/admin/v1/activity/type?id=${id}`,
      method: "DELETE",
    });
  }

  // 获取社群帖子
  getCommunityActList(id, params) {
    return this.request({
      url: `/admin/v1/activity/list?activity_type_id=${id}`,
      method: "GET",
      params,
    });
  }

  getCommunityDetail(id) {
    return this.request({
      url: `/admin/v1/activity?id=${id}`,
      method: "GET",
    });
  }

  addCommunityAct(data) {
    return this.request({
      url: `/admin/v1/activity`,
      method: "PUT",
      data,
    });
  }
  editCommunityAct(id, data) {
    return this.request({
      url: `/admin/v1/activity?id=${id}`,
      method: "POST",
      data,
    });
  }
  delCommunityAct(id) {
    return this.request({
      url: `/admin/v1/activity?id=${id}`,
      method: "DELETE",
    });
  }

  // 活动签到二维码
  getCommunityActivityCode(id) {
    return this.request({
      url: `/api/admin/topic_signin_qrcode/${id}`,
      method: "GET",
      responseType: "blob",
      transformResponse: [
        function (data) {
          // 对 data 进行任意转换处理
          return { code: 0, data };
        },
      ],
    });
  }
  // 活动已报名名单
  getCommunityActivityEnlistList(id, params) {
    return this.request({
      url: `/admin/v1/activity/get_sign_up_list?id=${id}`,
      method: "GET",
      params,
    });
  }
  // 活动已签到名单
  getCommunityActivitySignUpList(id, params) {
    return this.request({
      url: `/admin/v1/activity/get_sign_in_list?id=${id}`,
      method: "GET",
      params,
    });
  }

  // 活动签退名单
  getCommunityActivitySignOutList(id, params) {
    return this.request({
      url: `/admin/v1/activity/get_sign_out_list?id=${id}`,
      method: "GET",
      params,
    });
  }

  // 活动评论
  getCommunityActCommentsList(params) {
    return this.request({
      url: "/api/admin/topic_activity_comment/",
      method: "GET",
      params,
    });
  }
  // 删除评论
  delCommunityActComment(id) {
    return this.request({
      url: `/api/admin/topic_activity_comment/${id}/`,
      method: "DELETE",
    });
  }
  //#endregion

  //#region 场馆类型
  getVenueTypeList(params) {
    return this.request({
      url: "/admin/v1/venv/type/list",
      method: "GET",
      params,
    });
  }
  addVenueType(data) {
    return this.request({
      url: `/admin/v1/venv/type`,
      method: "PUT",
      data,
    });
  }
  editVenueType(id, data) {
    return this.request({
      url: `/admin/v1/venv/type?id=${id}`,
      method: "POST",
      data,
    });
  }
  delVenueType(id) {
    return this.request({
      url: `/admin/v1/venv/type?id=${id}`,
      method: "DELETE",
    });
  }
  //#endregion
  //#region 场馆列表
  getVenueList(params) {
    return this.request({
      url: "/admin/v1/venv/list",
      method: "GET",
      params,
    });
  }
  getVenueInfo(id) {
    return this.request({
      url: `/api/admin/venue/${id}/`,
      method: "GET",
    });
  }
  addVenue(data) {
    return this.request({
      url: `/admin/v1/venv`,
      method: "PUT",
      data,
    });
  }
  editVenue(id, data) {
    return this.request({
      url: `/admin/v1/venv?id=${id}`,
      method: "POST",
      data,
    });
  }
  delVenue(id) {
    return this.request({
      url: `/admin/v1/venv?id=${id}`,
      method: "DELETE",
    });
  }
  //#endregion
  //#region 场馆开放时间计费
  getVenueTimeList(id) {
    return this.request({
      url: `/admin/v1/venv/time/list?id=${id}`,
      method: "GET",
    });
  }
  addVenueTime(data) {
    return this.request({
      url: `/admin/v1/venv/time`,
      method: "PUT",
      data,
    });
  }
  editVenueTime(id, data) {
    return this.request({
      url: `/admin/v1/venv/time?id=${id}`,
      method: "POST",
      data,
    });
  }
  delVenueTime(id) {
    return this.request({
      url: `/admin/v1/venv/time?id=${id}`,
      method: "DELETE",
    });
  }
  //#endregion
  //#region 场馆订单
  getVenueOrderList(params) {
    return this.request({
      url: "/admin/v1/venv/order/list",
      method: "GET",
      params,
    });
  }
  //#endregion

  //#region 社区志愿者招募
  // 志愿者
  getCommunityVolunteerRosterList(params) {
    return this.request({
      url: "/api/admin/volunteer/apply/",
      method: "GET",
      params,
    });
  }
  getCommunityVolunteerRosterInfo(id) {
    return this.request({
      url: `/api/admin/volunteer/apply/${id}/`,
      method: "GET",
    });
  }
  setCommunityVolunteerRosterStatus(id, data) {
    return this.request({
      url: `/api/admin/volunteer/apply/${id}/`,
      method: "PUT",
      data,
    });
  }
  // 志愿者组织
  getCommunityVoluntGroupList(params) {
    return this.request({
      url: "/admin/v1/party_volunteer_activity/type",
      method: "GET",
      params,
    });
  }
  addCommunityVoluntGroup(data) {
    return this.request({
      url: `/admin/v1/party_volunteer_activity/type`,
      method: "PUT",
      data,
    });
  }
  editCommunityVoluntGroup(id, data) {
    return this.request({
      url: `/admin/v1/party_volunteer_activity/type?id=${id}`,
      method: "POST",
      data,
    });
  }
  delCommunityVoluntGroup(id) {
    return this.request({
      url: `/admin/v1/party_volunteer_activity/type?id=${id}`,
      method: "DELETE",
    });
  }
  // 入组审核
  getCommunityJoinVoluntGroupList(params) {
    return this.request({
      url: "/api/admin/volunteer/add_group/",
      method: "GET",
      params,
    });
  }
  getCommunityJoinVoluntGroupInfo(id) {
    return this.request({
      url: `/api/admin/volunteer/add_group/${id}/`,
      method: "GET",
    });
  }
  setCommunityJoinVoluntGroupStatus(id, data) {
    return this.request({
      url: `/api/admin/volunteer/add_group/${id}/`,
      method: "PUT",
      data,
    });
  }

  // 志愿者申请列表
  volunteerApplyList(params) {
    return this.request({
      url: "/admin/v1/party_volunteer/list",
      method: "GET",
      params,
    });
  }

  volunteerCheck(data) {
    return this.request({
      url: "/admin/v1/party_volunteer/user_check",
      method: "POST",
      data,
    });
  }

  //#endregion
  //#region 社区志愿者活动
  getCommunityVoluntActivityList(params) {
    return this.request({
      url: "/admin/v1/party_volunteer_activity/list",
      method: "GET",
      params,
    });
  }

  // 活动详情
  getCommunityVoluntActivityDetail(id) {
    return this.request({
      url: `/admin/v1/party_volunteer_activity?id=${id}`,
      method: "GET",
    });
  }

  addCommunityVoluntActivity(data) {
    return this.request({
      url: `/admin/v1/party_volunteer_activity`,
      method: "PUT",
      data,
    });
  }
  editCommunityVoluntActivity(id, data) {
    return this.request({
      url: `/admin/v1/party_volunteer_activity?id=${id}`,
      method: "POST",
      data,
    });
  }
  delCommunityVoluntActivity(id) {
    return this.request({
      url: `/admin/v1/party_volunteer_activity?id=${id}`,
      method: "DELETE",
    });
  }
  // 活动签到二维码
  getCommunityVoluntActivityCode(id) {
    return this.request({
      url: `/api/admin/volunteer_qrcode/${id}`,
      method: "GET",
      responseType: "blob",
      transformResponse: [
        function (data) {
          // 对 data 进行任意转换处理
          return { code: 0, data };
        },
      ],
    });
  }

  // 活动已报名名单
  getCommunityVoluntActivityEnlistList(id, params) {
    return this.request({
      url: `/admin/v1/party_volunteer_activity/get_sign_up_list?id=${id}`,
      method: "GET",
      params,
    });
  }

  // 活动已签到名单
  getCommunityVoluntActivitySignUpList(id, params) {
    return this.request({
      url: `/admin/v1/party_volunteer_activity/get_sign_in_list?id=${id}`,
      method: "GET",
      params,
    });
  }

  // 活动签退名单
  getCommunityVoluntActivitySignOutList(id, params) {
    return this.request({
      url: `/admin/v1/activity/get_sign_out_list?id=${id}`,
      method: "GET",
      params,
    });
  }
  //#endregion

  //#region 周边管理

  getBusinessType() {
    return this.request({
      url: "/admin/v1/shop/type",
      method: "GET",
    });
  }

  getBusinessList(id, params) {
    return this.request({
      url: `/admin/v1/shop/list?shop_type_id=${id}`,
      method: "GET",
      params,
    });
  }

  addBusiness(data) {
    return this.request({
      url: `/admin/v1/shop`,
      method: "PUT",
      data,
    });
  }
  editBusiness(id, data) {
    return this.request({
      url: `/admin/v1/shop?id=${id}`,
      method: "POST",
      data,
    });
  }
  delBusiness(id) {
    return this.request({
      url: `/admin/v1/shop?id=${id}`,
      method: "DELETE",
    });
  }
}
